home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / ZenithBrainwave_Just4YourE.lha / Just4YourEarsHD / Install-Just4YourEars next >
Text File  |  2001-04-24  |  5KB  |  229 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")        ;name of the readme file
  4. (set #highs-file "highs")        ;name of high scores file
  5.  
  6. (procedure P_MakeImages
  7.  
  8.   ;the following lines must be copied and adjusted for multiple disk images
  9.  
  10.   (set #CI_disknum 1)
  11.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  12.   (set #CI_disklen 901120)
  13.   (set #CI_skiptrk -1)
  14.   (P_CreateImage)
  15.  
  16.   (set #CI_disknum 2)
  17.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  18.   (P_CreateImage)
  19.  
  20. )
  21.  
  22. ;****************************
  23. ;----------------------------
  24. ; checks if given program is installed, if not abort install
  25. ; #program - to check
  26.  
  27. (procedure P_ChkRun
  28.   (if
  29.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  30.     ("")
  31.     (abort 
  32.       (cat
  33.     "You must install \"" #program "\" first!\n"
  34.     "It must be accessible via the path.\n"
  35.     "You can find it in the WHDLoad package."
  36.       )
  37.     )
  38.   )
  39. )
  40.  
  41. ;----------------------------
  42. ; Create Image using DIC
  43. ; #dest        - path to save image in
  44. ; #CI_disknum  - number of the disk image to create
  45. ; #CI_diskname - label of the disk
  46. ; #CI_disklen  - length of disk image to create
  47. ; #CI_skiptrk  - track to skip, -1 means no skip
  48. ; #CI_drive    - drive to create image from
  49.  
  50. (procedure P_CreateImage
  51.   (message
  52.     (cat
  53.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  54.     "(make sure it's the right disk because it will not be checked)"
  55.     )
  56.   )
  57.   (if
  58.     (>= #CI_skiptrk 0)
  59.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  60.     (set #option "")
  61.   )
  62.   (if
  63.     (= 0
  64.       (run 
  65.         (cat
  66.           "cd \"" #dest "\"\n"
  67.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  68.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  69.         )
  70.       )
  71.     )
  72.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  73.     (abort "\"DIC\" has failed to create a diskimage")
  74.   )
  75. )
  76.  
  77. ;****************************
  78.  
  79. (if
  80.   (exists #readme-file)
  81.   (if
  82.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  83.     ("")
  84.     (run ("SYS:Utilities/More %s" #readme-file))
  85.   )
  86. )
  87.  
  88. (set #program "WHDLoad")
  89. (P_ChkRun)
  90.  
  91. (set #program "DIC")
  92. (P_ChkRun)
  93.  
  94. ; in expert mode ask for source drive
  95. (if
  96.   (= @user-level 2)
  97.   (
  98.     (set #CI_drive
  99.       (askchoice
  100.     (prompt "Select source drive for diskimages")
  101.     (default 0)
  102.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  103.     (help @askchoice-help)
  104.       )
  105.     )
  106.     (select #CI_drive
  107.       (set #CI_drive "DF0:")
  108.       (set #CI_drive "DF1:")
  109.       (set #CI_drive "RAD:")
  110.       (set #CI_drive
  111.         (askstring
  112.           (prompt "Select source drive for diskimages")
  113.           (default "DF0:")
  114.           (help @askstring-help)
  115.         )
  116.       )
  117.     )
  118.   )
  119.   (set #CI_drive "DF0:")
  120. )
  121.  
  122. (set @default-dest
  123.   (askdir
  124.     (prompt 
  125.       (cat
  126.     "Where should \"" @app-name "\" be installed?\n"
  127.     "A drawer \"" @app-name "\" will be automatically created."
  128.       )
  129.     )
  130.     (help @askdir-help)
  131.     (default @default-dest)
  132.     (disk)
  133.   )
  134. )
  135. (set #dest (tackon @default-dest @app-name))
  136. (if
  137.   (exists #dest)
  138.   (
  139.     (set #choice
  140.       (askbool
  141.         (prompt
  142.           (cat
  143.             "\nDirectory \"" #dest "\" already exists.\n"
  144.             "Should it be deleted?"
  145.           )
  146.         )
  147.         (default 1)
  148.         (choices "Delete" "Skip")
  149.         (help @askbool-help)
  150.       )
  151.     )
  152.     (if
  153.       (= #choice 1)
  154.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  155.     )
  156.   )
  157. )
  158. (makedir #dest
  159.   (help @makedir-help)
  160.   (infos)
  161. )
  162.  
  163. ;----------------------------
  164.  
  165. (copyfiles
  166.   (help @copyfiles-help)
  167.   (source ("%s.Slave" @app-name))
  168.   (dest #dest)
  169. )
  170. (if
  171.   (exists ("%s.newicon" @app-name))
  172.   (set #icon
  173.     (askchoice
  174.       (prompt "\nWhich icon would you like to install?\n")
  175.       (default 0)
  176.       (choices "Color Icon" "NewIcon")
  177.       (help @askchoice-help)
  178.     )
  179.   )
  180.   (set #icon 0)
  181. )
  182. (select #icon
  183.   (set #icon ("%s.coloricon" @app-name))
  184.   (set #icon ("%s.newicon" @app-name))
  185. )
  186. (copyfiles
  187.   (help @copyfiles-help)
  188.   (source #icon)
  189.   (newname ("%s.info" @app-name))
  190.   (dest #dest)
  191. )
  192. (if
  193.   (exists #readme-file)
  194.   (copyfiles
  195.     (help @copyfiles-help)
  196.     (source #readme-file)
  197.     (dest #dest)
  198.   )
  199. )
  200. (if
  201.   (exists ("%s.info" #readme-file))
  202.   (
  203.     (copyfiles
  204.       (help @copyfiles-help)
  205.       (source ("%s.info" #readme-file))
  206.       (dest #dest)
  207.     )
  208.     (tooltype
  209.       (dest (tackon #dest #readme-file))
  210.       (noposition)
  211.     )
  212.   )
  213. )
  214. (if
  215.   (exists #highs-file)
  216.   (copyfiles
  217.     (help @copyfiles-help)
  218.     (source #highs-file)
  219.     (dest #dest)
  220.   )
  221. )
  222.  
  223. (P_MakeImages)
  224.  
  225. ;----------------------------
  226.  
  227. (exit)
  228.  
  229.